package instruments;

import data.GridCell;
import data.NavmeshRegion;

/**
 * @author sad
 */
public class MakeUnWalkableInstrument extends AbstractPolygonInstrument {
    @Override
    public void mouseDown(int x, int y, int modifiers) {
        super.mouseDown(x, y, modifiers);
        NavmeshRegion p = trySelect(x, y);
        if (p == null) {
            return;
        }

        if (isLeftDown(modifiers)) {
            GridCell gridCell = p.getGridCell(x, y);
            gridCell.setActive(!gridCell.isActive());
            redraw();
        }
    }
}
